<?php
namespace app\admin\validate;
use think\Validate;

class Article extends Validate
{
	protected $rule=[
		['title','require|max:20','标题必须传递|长度不能超过20个字符'],
		['column','number'],
		['art_type','number'],
		['listorder','number'],
		['abstract','min:10','摘要长度不能少于10个字符'],
		['author','require'],
		['source','require'],
		['msg','require'],
	];
	
	/**场景设置**/
	protected $scene = [
		'add' => ['title','column','art_type','abstract'],//添加
		'listorder' => ['id', 'listorder'], //排序
	];
	
    public function index()
    {
 		return $this->fetch();
    }
}